package com.example.repository;

import com.example.entity.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends BaseRepository<User> {

    @Query(value = "from User u where u.username=:username")
    User findByUsername(@Param("username") String username);

    @Query(value = "from User u where u.email=:email")
    User findByEmail(@Param("email") String email);

    @Query(value = "from User u where u.phoneNumber=:phoneNumber")
    User findByPhoneNumber(@Param("phoneNumber") String phoneNumber);
}
